<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/11
 * Time: 23:51
 */
namespace app\admin\validate;

use think\Validate;


class AdminValidate extends Validate
{

    protected $rule = [
        "id" => 'number|between:1,10000000000|require|checkModel',
        "password" => "regex:(.*){6,}|min:6|require",
//staffeditdaili
        "password" =>[
            "base"=>"regex:(.*){6,}|min:6|require",//添加操作 比传
            "staffeditdaili#agenteditdaili"=>"min:6", //搜索操作非必传
        ] ,//状态
        "mobile" => ["regex" => "^\d{11}$"],
        "tel" =>[
            "base"=>["regex" => "^\d{11}$"],//添加操作 比传
            "agentindex#staffindex"=>"number", //搜索操作非必传
        ] ,//状态

        "mobile" =>[
            "base"=>["regex" => "^\d{11}$"],//添加操作 比传
            "usersindex#usersdisenable"=>"number", //搜索操作非必传
        ] ,//状态
        "sharecode" => "require",

        "attribute" => "require|number|max:16",
        "name" => "require|max:25|chsAlphaNum",//暂时没用到
        "code" =>[
            "base"=>"require",//添加操作 比传
            "offerindex"=>"number", //搜索操作非必传
        ] ,//状

        "admin_group_id" => "require|number|egt:1",//暂时没用到
        "user_name" => "max:25", //用户名搜索
        "start_time" => "date",
        "end_time" => "date",
        "inquir_id" => "require|number|between:1,10000000000",
        "manage_per" => "require|float",//管理费率
        "manage_money" => "require|float",
        "bank_name" => "require|chsAlphaNum", //银行名称
        "bank_no" => ["require", "regex" => "\d{16,}$"],//银行卡号
        "account_name" => "require|chsAlphaNum",//账户名
        "bank_config_name" => "require|number|between:1,10000000000",
        "user_id" =>[
            "base"=>"require|between:1,10000000000",//添加操作 比传
            "usersindex#usersdisenable#usersbanklist#orderdetailsrevokeapply#usersidcards"=>"number|between:1,10000000000", //搜索操作非必传
        ] ,//状

        "option_code" => "require|chsAlphaNum|max:32",//期权编号
        "province" => "require|chsAlphaNum",//期权编号
        "city" => "require|chsAlphaNum",//期权编号
        "district" => "require|chsAlphaNum",//期权编号
        "mobiles" => ["require", "number", "regex" => "^\d{11}$"],//期权编号
        "Initial_price" => "require|float|max:10",//期权编号
        "exercise_price" => "require|float|max:10",//期权编号
        "equity_nums" => "require|between:1,100000000000|number|max:22",//期权编号
        "id_card_status" => "require|min:1",//期权编号
        "contacts" => "require",//期权编号
        "commission" => "require|elt:100",//期权编号
        "commison" => "require",//期权编号
        "is_bank_status" => "require|in:0,1|length:1",//期权编号
        "state" => "require|in:0,1|length:1",//期权编号
        "contacts_tel" =>  ["require", "number", "regex" => "^\d{11}$","length"=>11],//期权编号
        "status" =>[
            "base"=>"require|in:0,1,2,3,4|length:1",//添加操作 比传
            "aenquiryindex#aenquirysucceed#orderdetailswaste#orderdetailsindex#orderdetailsping#orderdetailsposition#orderdetailstransaction#orderdetailswaste#rechargeindex"=>"in:0,1,2,3,4|length:1", //搜索操作非必传
            ] ,//状态
        "is_images" => "in:0,1|length:1",//状态

        "is_position" => "require|in:0,1|length:1",//状态
        "type" =>[
            "base"=>"require|in:1,2|length:1",//添加操作 比传
            "rechargeindex#generalizeindex"=>"in:1,2|length:1", //搜索操作非必传
        ] ,//状态
        "is_admin" => "in:1,0|length:1",//状态
        "area" => "require|chs|max:10",//區域
        "cash" => "require|number|between:0,1000000000000",//保證金
        "staff_no" => "require",//期权编号
        "staff_name" => "require|max:25|chsAlphaNum",//期权编号

        "staff_name" =>[
            "base"=>"require|max:25|chsAlphaNum",//添加操作 比传
            "commissionindex"=>"min:1", //搜索操作非必传
        ] ,//状
        "remark" => "max:25|chsAlphaNum",//期权编号
        "newtype" => "max:25|number",//期权编号
        "agent_id" => "max:25|number",//期权编号
        "protocol_id" => "max:25|number",//期权编号
        "role_name" => "require|max:25|chsAlphaNum",//期权编号
        "kaihui_bank" => "require|max:25|chsAlphaNum",//期权编号
      //  "real_name" => "require|max:5|chsAlphaNum",//期权编号
        "agent_ids" => "require|gt:0|number",//期权编号
        "totalAssets" => "require|gt:0|number",//期权编号
        //"agent_name" => "require",//期权编号
       // "agent_name2" => "max:15",//期权编号
        "agent_name" =>[
            "base"=>"require",//添加操作 比传
            "commissionindex"=>"max:15", //搜索操作非必传
        ] ,//状
        "displayorder" => "require|number|max:15",//期权编号
        "content" => "require",//期权编号
        "title" => "require|max:25",//期权编号
        "image" => "min:1",//期权编号
        "layer_privilege" => "max:525",//期权编号
        "privilege" => "require",//期权编号
        "value" => "min:1",//期权编号
        "link" => "max:122",//期权编号
        "wenti" => "max:1222|require",//期权编号
        "daan" => "max:3122|require",//期权编号
        "deposit" => "number|require|max:15",//期权编号
        "level" => "number|max:15",//期权编号
        "app_logo" => "min:1",//期权编号
        "admin_logo" => "min:1",//期权编号
        "main_logo_zhuye" => "min:1",//期权编号
        "main_thumb" => "min:1",//期权编号
        "confirmation" => "min:1",//期权编号

        "special_version" => "min:1",//期权编号
        "app_title" => "min:1",//期权编号
        "admin_copywriting_title" => "min:1",//期权编号
        "admin_copywriting_content" => "min:1",//期权编号
        "company_name" => "min:1",//期权编号
        "h5_url" => "min:1",//期权编号,
        "time_out_fail" => "min:1",//期权编号,
        "key"=>"require|min:1",
        "staff_id"=>"min:1",
        "payment"=>"require|array",
        "one" => "max:10|number",//期权编号
        "two" => "max:10|number",//期权编号
        "three" => "max:10|number",//期权编号
        "four" => "max:10|number",//期权编号
        "five" => "max:10|number",//期权编号
        "six" => "max:10|number",//期权编号
        "seven" => "max:10|number",//期权编号
        "eight" => "max:10|number",//期权编号
        "nine" => "max:10|number",//期权编号
        "ten" => "max:10|number",//期权编号
        "eleven" => "max:10|number",//期权编号
        "twelve" => "max:10|number",//期权编号
        "fday" => "max:10|number",//期权编号
        "tday" => "max:10|number",//期权编号
        "auth" => "max:100|require",//权限
        "tilte" => "max:100|require",//权限
        "attributeCode" =>[
            "base"=>"require|max:15",//添加操作 比传
            "offerupcode"=>"max:15", //搜索操作非必传
        ] ,//状
      //  "" => "max:20",//权限


        "position_key" =>[
            "positionsave"=>"checkModel_depend_no:PcSitePosition|require",//添加操作 比传
            "pcsitesave|pcsiteindex"=>"checkModel_depend:PcSitePosition|require", //搜索操作非必传
        ] ,//状

        "sub_content" => "max:500",//权限
        "money_value_date" => "max:500|require",//权限
        "money_expiry_date" => "max:500|require",//权限
        "direction" => "max:2",//权限
        "ordersn" => "max:100",//权限
        "sex" => "max:100",//权限
        "id_number" => "max:100",//权限
        "yidongdianhua" => "max:100",//权限
        "youbian" => "max:100",//权限
        "dianziyouxiang" => "max:100",//权限
        "zhuzhi" => "max:100",//权限
        "zicguimo1" => "max:100",//权限
        "zicguimo2" => "max:100",//权限
        "touzhijingli" => "max:100",//权限
        "touzhijingli2" => "max:100",//权限
        "jiaoyishouyiren" => "max:100",//权限
        "buliang" => "max:100",//权限
        "total" => "max:100",//权限
        "daan" => "max:100",//权限
        "grade" => "max:100",//权限
        "age" => "max:100",//权限
        "image" => "min:1",//权限
        "htimage" => "min:1",//权限
        "CertName" => "max:100",//权限
        "CertNo" => "max:100",//权限
        "Phone" => "max:100",//权限
        "bank_no" => "max:100",//权限
        "bank_general_name" => "max:100",//权限
        "bank_name" => "max:100",//权限
        "qcode_cz_add" => "min:1",//权限
        "qcode_cz_bankno" => "min:1",//权限
        "qcode_cz_zy" => "min:1",//权限
        "qcode_cz" => "min:1",//权限
        "qcode_url" => "min:1",//权限
        "qcode_cz_name" => "min:1",//权限


        //"id_number","yidongdianhua","youbian","dianziyouxiang","zhuzhi","zicguimo1","zicguimo2","touzhijingli","touzhijingli2","jiaoyishouyiren","buliang","total","daan","grade","age","image", "htimage"
        "auto" => "in:1,0|length:1",//权限

    ];

    //['deposit',"CertName","CertNo","Phone","bank_no","bank_general_name","bank_name"]
//"one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","fifteen","fday","tday"
    protected $message = [
        "password" => "用户密码",
        "mobile" => "手机号码",
        "tel" => "手机号码",
        "sharecode" => "股票标地",
        "attribute" => "股票属性",
        "name" => "名称",//暂时没用到
        "code" => "股票号码",//暂时没用到
        "admin_group_id" => "角色",//暂时没用到
        "user_name" => "姓名", //用户名搜索
        "start_time" => "开始时间",
        "end_time" => "结束时间",
        "user_id" => "用户ID",
        "inquir_id" => "询价ID",
        "manage_per" => "管理费率",//管理费率
        "manage_money" => "管理费",
        "bank_name" => "银行名称", //银行名称
        "bank_no" => "银行卡号",//银行卡号
        "account_name" => "账户名",//账户名
        "bank_config_name" => "所属银行",
        "option_code" => "期权编号",//期权编号
        "province" => "省",//期权编号
        "city" => "城市",//期权编号
        "district" => "区",//期权编号
        "mobiles" => "手机号码",//期权编号
        "Initial_price" => "期初价格",//期权编号
        "exercise_price" => "行权价格",//期权编号
        "equity_nums" => "股票数量",//期权编号
        "id_card_status" => "认证状态",//期权编号
        "contacts" => "联系人",//期权编号
        "commission" => "用户",//期权编号
        "is_bank_status" => "是否提现",//期权编号
        "contacts_tel" =>  "手机号码",//期权编号
        "status" => "状态",//状态
        "is_position" => "是否指定",//状态
        "is_admin" => "管理员",//状态
        "type" => "类型",//状态
        "area" => "區域",//區域
        "cash" => "保证金",//保證金
        "staff_no" => "员工编号",//期权编号
        "staff_name" => "员工名称",//期权编号
        "remark" => "备注",//期权编号
        "newtype" => "类型",//期权编号
        "agent_id" => "代理商ID",//期权编号
        "protocol_id" => "协议ID",//期权编号
        "role_name" => "角色名称",//期权编号
        "kaihui_bank" => "开户行",//期权编号
        "real_name" => "真名",//期权编号
        "agent_ids" => "代理商ID",//期权编号
        "totalAssets" => "成交额",//期权编号
        "agent_name" => "代理商名称",//期权编号
        "content" => "内容",//期权编号
        "title" => "标题",//期权编号
        "image" => "图像",//期权编号
        "layer_privilege" => "权限",//期权编号
        "privilege" => "权限",//期权编号
        "value" => "值",//期权编号
        "link" => "连接",//期权编号
        "wenti" => "问题",//期权编号
        "daan" => "答案",//期权编号
        "deposit" => "充值金额",//期权编号
        "level" => "等级",//期权编号
        "app_logo" => "前台logo",//期权编号
        "admin_logo" => "后台logo",//期权编号
        "main_logo_zhuye" => "主页logo",//期权编号
        "main_thumb" => "缩略图",//期权编号
        "confirmation" => "确认信息",//期权编号
        "special_version" => "特殊申明",//期权编号
        "app_title" => "app标题",//期权编号
        "admin_copywriting_title" => "登录标题",//期权编号
        "admin_copywriting_content" => "内容",//期权编号
        "company_name" => "公司名称",//期权编号
        "h5_url" => "前台推广地址",//期权编号,
        "key"=>"设置key",
        "payment"=>"交易设置数据",
        "one"=>"一个月管理费率",
        "two"=>"二个月管理费率",
        "three"=>"三个月管理费率",
        "four"=>"四个月管理费率",
        "five"=>"五个月管理费率",
        "six"=>"六个月管理费率",
        "seven"=>"七个月管理费率",
        "eight"=>"八个月管理费率",
        "nine"=>"九个月管理费率",
        "ten"=>"十个月管理费率",
        "eleven"=>"十一个月管理费率",
        "twelve"=>"十二个月管理费率",
        "fifteen"=>"十五天管理费率",
        "fday"=>"五天管理费率",
        "tday"=>"十天管理费率",
        "auth"=>"代理商角色",//代理商拥有的角色
        "position_key"=>"位置标识",//代理商拥有的角色
        "position_key2"=>"位置标识",//代理商拥有的角色
        "is_images"=>"是否是图片",//代理商拥有的角色
        "sub_content"=>"内容",//代理商拥有的角色
        "tilte"=>"标题",//代理商拥有的角色
    ];


    protected $scene = [
        /**
         *  首页位置配置
         */
        "positionsave"=>["position_key","name"],
        "positionup"=>["id","name"],
        /**
         *  help
         */
        "helpsave"=>["tilte","content"],
        "helpup"=>["id","content","tilte"],
        /**
         *  首頁站點信息配置
         */
        "pcsiteindex"=>['position_key'],
        "pcsitesave"=>['position_key',"key","value","is_images","title","sub_content"],
        "pcsiteup"=>["key","value","is_images","title","id","sub_content"],
        /**
         *  股票设置
         */
        "offersave"=>["attributeCode","code","name","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","fifteen","fday","tday",],
        "offerupcode"=>["attributeCode","code","name","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","fifteen","fday","tday"],
        "offerindex"=>["code"],
        /**
         *  站点设置
         */
        'sitesave'=>["time_out_fail","h5_url","company_name","app_logo","admin_logo","main_logo_zhuye","main_thumb","confirmation","tel","special_version","app_title","admin_copywriting_title","admin_copywriting_content","qcode_cz_add","qcode_cz_zy","qcode_cz_bankno","qcode_cz","qcode_url","qcode_cz_name"],

        /**
         * 用户设置
         */
        "usersindex" => ["user_id", "mobile", "user_name", "start_time", "end_time","agent_key_no"],
        "userscinfo" => ["user_name","sex","id_number","yidongdianhua","youbian","dianziyouxiang","zhuzhi","zicguimo1","zicguimo2","touzhijingli","touzhijingli2","jiaoyishouyiren","buliang","total","daan","grade","age","user_id"],
        "usersdisenable" => ["user_id", "mobile", "user_name", "start_time", "end_time","agent_id"],
        "userssave" => ["mobile", "user_name"],
        "userschangestate" => ["state", "id"],
        "usersbanklist" => ["user_id"],
        "usersrecharge" => ["mobile", "user_id", "deposit", "bank_id"],
        "usersbasic" => [  "user_id"],
        "usersbasicfail" => [  "user_id"],


        /**
         *  询价操作
         */
        "aenquiryconfirmstatus" => ["inquir_id", "manage_per", "manage_money", "option_code","protocol_id"],
        "aenquiryindex" => ["mobile", "start_time", "end_time", 'status',"auto"],
        "aenquirysucceed" => ["mobile", "start_time", "end_time", 'status',"auto"],
        "orderdetailswaste" => ["mobile", "start_time", "end_time", 'status'],
        "aenquiryping" => ["mobile", "start_time", "end_time", 'status'],
        "aenquiryposition" => ["mobile", "start_time", "end_time", 'status'],

        /**
         *  银行
         */
        "bankindex" => ["mobile"],
        "banksave" => ["bank_name", "bank_no", "account_name", "bank_config_name", "user_id", "province", "city", "district", "mobiles"],
        "bankupbank" => ["bank_name", "bank_no", "account_name", "bank_config_name", "bank_id","mobile"],


        /**
         *  订单系列
         */
        "orderdetailsindex" => ["mobile", "status", "start_time", "end_time","ordersn"],
        "orderdetailsping" => ["mobile", "status", "start_time", "end_time","ordersn"],
        "orderdetailsposition" => ["mobile", "start_time", "end_time","status","ordersn"],
        "orderdetailswaste" => ["mobile", "start_time", "end_time","direction","ordersn"],
        "orderdetailstransaction" => ["mobile",  "start_time", "end_time","ordersn","direction"],
        "orderdetailsaudit" => ["id"],
        "orderdetailsbohui" => ["id"],
        "orderdetailsabolish" => ["id"],
        "orderdetailschangebeginning" => ["order_id","Initial_price"],
        "orderdetailsselllast" => ["exercise_price", "id"],
        "orderdetailsrevokeapply" => ["order_id", "user_id"],
        "orderdetailsdelegation" => ["id", "option_code", "Initial_price", "equity_nums", "remark", "manage_per","totalAssets","money_value_date","money_expiry_date"],
        // "orderdetailssellapply"=>["id"],

        /**
         *  日志
         */
        "accountlogindex" => ["start_time", "end_time","is_admin"],

        /**
         *  充值系列
         */
        "rechargeindex" => ["start_time", "end_time", "mobile", "status", "type"],
        "rechargeread" => ["id"],
        "rechargechangestatus" => ["id"], //审核充值id
        "rechargechangetx" => ["id"], //审核充值id
        "rechargereject" => ["id"], //审核充值id


        "payforsave" => ['deposit',"CertName","CertNo","Phone","bank_no","bank_general_name","bank_name"], //审核充值id

        /**
         *  日志系列
         */
        "journalindex"=>["start_time","end_time","newtype","mobile","is_admin"], //审核充值id

        /**
         *  代理系列
         */
        "agentindex"=>["agent_id","tel","level"], //审核充值id
        "agenttree"=>["agent_id"], //审核充值id
        "agentsave"=>["auth","kaihui_bank","bank_name","agent_id","contacts_tel","area","is_bank_status","bank_no","cash","commission","status","agent_name","remark","password"], //审核充值id
        "agenteditdaili"=>["auth","agent_name","kaihui_bank","bank_name","id","contacts_tel","area","is_bank_status","bank_no","cash","commission","status","agent_name","agent_id","remark","password"], //审核充值id
        "staffeditdaili"=>["id","is_m_show","user_name","tel","commison","password","login_status","status","admin_group_id","remark","agent_id","staff_name"], //审核充值id

        /**
         *  后台用户系列
         */
        "staffindex"=>["agent_ids","tel"], //审核充值id
        "staffeditpswd"=>["password"], //审核充值id
        "staffsave"=>["is_m_show","user_name","tel","commison","password","login_status","status","admin_group_id","remark","agent_id","staff_name"], //审核充值id

        /**
         *  角色系列
         */
        "rolesave"=>["role_name"],
        "roledel"=>["id"],
        "roleeditpower"=>["privilege","layer_privilege","id"], //增加权限

        /**
         *  推广系列
         */
        "generalizeindex"=>["type"],

        /**
         *  后台充值
         */
        "rechargeagentrecharge"=>["deposit"],
        "rechargestaffrecharge"=>["deposit"],
        "rechargeagentwithdraw"=>["deposit"],//



        "usersidcards"=>["user_id"],//


        "generalizecreatecode"=>["id"],//

        /**
         *   资讯系列
         */
        "informationsave"=>["image","title","content"],//
        "informationdisorder"=>["id","displayorder"],//
        "informationupdateit"=>["image","title","content","id"],//
        "informationdel"=>["id"],//
        /**
         *  协议
         */
        "protocosave"=>["image","title","content","type","is_position"],//
        "protocodel"=>["id"],//
        "protocoupdateit"=>["image","title","content","id","type","is_position"],//


        /**
         *  广告管理
         */
        "advertisingsave"=>["title","image","link","status"],//
        "advertisingupdateit"=>["title","image","link","status","id"],//
        "advertisingdel"=>["id"],//

        /**
         *  题目设计
         */
        "timuupdateit"=>["wenti","daan","id","getgrade"],//
        "timusave"=>["wenti","daan","getgrade"],//
        "timudel"=>["id"],//

        /**
         *   配置
         */
        "configsupdateit"=>["id","is_position","value"],//
        "paymentconfigsave"=>["key","payment"],//
        /**
         *  代理佣金
         */
        "commissionindex"=>["start_time","end_time","agent_name","mobile","staff_name","ordersn"],//

        "userschange"=>["id","agent_id","staff_id"],//
        "messageimessage"=>["id"],


];

}